/*
 * @Author: your name
 * @Date: 2021-12-22 15:57:58
 * @LastEditTime: 2021-12-22 17:09:44
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \child2-vue\src\main.js
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import singleSpaVue from "single-spa-vue"
import store from "./store"
Vue.config.productionTip = false

const appOptions = {
  el:"#microApp",
  router,
  store,
  render: h => h(App)
}
const lifeCycle = singleSpaVue({
  Vue,
  appOptions
})
function render(el="#app"){
  new Vue(appOptions).$mount(el)
}


if(window.singleSpaNavigate){
  // eslint-disable-next-line no-undef
  __webpack_public_path__ = `//localhost:9975/`;
} else {
  render('#app')
}
export const bootstrap = lifeCycle.bootstrap
export function mount (props) {
  store.commit("setParentData",props.data)
  return lifeCycle.mount(() => {})
}
// export const unmount = lifeCycle.unmount
export async function unmount() {
  return lifeCycle.unmount(() => {})
}